<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, shrink-to-fit=no">
    <title>Table - Brand</title>
    <link rel="stylesheet" href="assets/bootstrap/css/bootstrap.min.css">
    <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Nunito:200,200i,300,300i,400,400i,600,600i,700,700i,800,800i,900,900i">
    <link rel="stylesheet" href="assets/fonts/fontawesome-all.min.css">
</head>

<body id="page-top">
<div id="app">
    <div id="wrapper">
        <nav class="navbar navbar-dark align-items-start sidebar sidebar-dark accordion bg-gradient-primary p-0">
            <div class="container-fluid d-flex flex-column p-0"><a class="navbar-brand d-flex justify-content-center align-items-center sidebar-brand m-0" href="#">
                    <div class="sidebar-brand-icon rotate-n-15"></div>
                    <div class="sidebar-brand-text mx-3"><span>主页</span></div>
                </a>
                <hr class="sidebar-divider my-0">
                <ul class="navbar-nav text-light" id="accordionSidebar">
                    <li class="nav-item"></li>
                    <li class="nav-item"><a class="nav-link" href="user.html"><span>用户信息管理</span></a></li>
                    <li class="nav-item"><a class="nav-link" href="school.html">院校信息管理</a></li>
                    <li class="nav-item"><a class="nav-link" href="major.html"><span>专业信息管理</span></a></li>
                    <li class="nav-item"><a class="nav-link" href="http://localhost:8081/index"><span>返回用户主页</span></a></li>
                    <li class="nav-item"><a class="nav-link" @click="goOffline()"><span>退出登陆</span></a></li>
                </ul>
<!--                <div class="text-center d-none d-md-inline"><button class="btn rounded-circle border-0" id="sidebarToggle" type="button"></button></div>-->
            </div>
        </nav>
        <div class="d-flex flex-column" id="content-wrapper">
            <div id="content">
                <nav class="navbar navbar-light navbar-expand bg-white shadow mb-4 topbar static-top">
                    <div class="container-fluid"><button class="btn btn-link d-md-none rounded-circle me-3" id="sidebarToggleTop" type="button"><i class="fas fa-bars"></i></button>
                        <form class="d-none d-sm-inline-block me-auto ms-md-3 my-2 my-md-0 mw-100 navbar-search">
                            <div class="input-group"><input class="bg-light form-control border-0 small" type="text" placeholder="搜索"><button class="btn btn-primary py-0" type="button"><i class="fas fa-search"></i></button></div>
                        </form>
                        <ul class="navbar-nav flex-nowrap ms-auto">
                            <li class="nav-item dropdown d-sm-none no-arrow"><a class="dropdown-toggle nav-link" aria-expanded="false" data-bs-toggle="dropdown" href="#"><i class="fas fa-search"></i></a>
                                <div class="dropdown-menu dropdown-menu-end p-3 animated--grow-in" aria-labelledby="searchDropdown">
                                    <form class="me-auto navbar-search w-100">
                                        <div class="input-group"><input class="bg-light form-control border-0 small" type="text" placeholder="Search for ...">
                                            <div class="input-group-append"><button class="btn btn-primary py-0" type="button"><i class="fas fa-search"></i></button></div>
                                        </div>
                                    </form>
                                </div>
                            </li>
                            <li class="nav-item dropdown no-arrow mx-1"></li>
                            <li class="nav-item dropdown no-arrow mx-1">
                                <div class="shadow dropdown-list dropdown-menu dropdown-menu-end" aria-labelledby="alertsDropdown"></div>
                            </li>
                            <li class="nav-item dropdown no-arrow">
                                <div class="nav-item dropdown no-arrow"><a class="dropdown-toggle nav-link" aria-expanded="false" data-bs-toggle="dropdown" href="#"><span class="d-none d-lg-inline me-2 text-gray-600 small">管理员</span></a>
                                    <div class="dropdown-menu shadow dropdown-menu-end animated--grow-in"><a class="dropdown-item" href="#"><i class="fas fa-user fa-sm fa-fw me-2 text-gray-400"></i>&nbsp;Profile</a><a class="dropdown-item" href="#"><i class="fas fa-cogs fa-sm fa-fw me-2 text-gray-400"></i>&nbsp;Settings</a><a class="dropdown-item" href="#"><i class="fas fa-list fa-sm fa-fw me-2 text-gray-400"></i>&nbsp;Activity log</a>
                                        <div class="dropdown-divider"></div><a class="dropdown-item" href="#"><i class="fas fa-sign-out-alt fa-sm fa-fw me-2 text-gray-400"></i>&nbsp;Logout</a>
                                    </div>
                                </div>
                            </li>
                        </ul>
                    </div>
                </nav>
                <div class="container-fluid">
                    <h3 class="text-dark mb-4">专业</h3>
                    <div class="card shadow">
                        <div class="card-header py-3">
                            <p class="text-primary m-0 fw-bold">基本信息</p>
                        </div>
                        <div class="card-body">
                            <div class="table-responsive table mt-2" id="dataTable" role="grid" aria-describedby="dataTable_info">
                                <table class="table my-0" id="dataTable">
                                    <thead>
                                        <tr>
                                            <th style="width: 66px;">属性</th>
                                            <th style="width: 104px;">初始值</th>
                                            <th style="width: 165px;">更改</th>
                                            <th style="width: 151px;">操作</th>
                                        </tr>
                                    </thead>
                                    <tbody>
                                        <tr style="height: 41px;">
                                            <td>专业名称</td>
                                            <td>计算机科学与技术</td>
                                            <td><input type="text" placeholder="专业名称" style="margin: 0px;padding: 0px;"></td>
                                            <td style="padding: 0px;"><button class="btn btn-primary" type="button" style="width: 76.7031px;height: 36px;padding: 2px;margin: 2px;border-radius: 3px;padding-top: 2px;margin-top: 4px;">修改</button></td>
                                        </tr>
                                        <tr>
                                            <td>类型</td>
                                            <td>计算机类</td>
                                            <td><input type="text" placeholder="类型"></td>
                                            <td style="padding: 0px;"><button class="btn btn-primary" type="button" style="width: 76.7031px;height: 36px;padding: 2px;margin: 2px;border-radius: 3px;padding-top: 2px;margin-top: 4px;">修改</button></td>
                                        </tr>
                                        <tr>
                                            <td>等级</td>
                                            <td>本科</td>
                                            <td><input type="text" placeholder="等级"></td>
                                            <td style="padding: 0px;"><button class="btn btn-primary" type="button" style="width: 76.7031px;height: 36px;padding: 2px;margin: 2px;border-radius: 3px;padding-top: 2px;margin-top: 4px;">修改</button></td>
                                        </tr>
                                    </tbody>
                                    <tfoot>
                                        <tr></tr>
                                    </tfoot>
                                </table>
                            </div>
                        </div>
                    </div>
                    <div class="card shadow">
                        <div class="card-header py-3">
                            <p class="text-primary m-0 fw-bold">简介</p>
                        </div>
                        <div class="card-body">
                            <div class="table-responsive table mt-2" id="dataTable-1" role="grid" aria-describedby="dataTable_info">
                                <table class="table my-0" id="dataTable">
                                    <thead>
                                        <tr>
                                            <th style="width: 66px;">初始值</th>
                                        </tr>
                                    </thead>
                                    <tbody>
                                        <tr style="height: 41px;">
                                            <td style="width: 1116px;">秃头专业</td>
                                        </tr>
                                        <tr></tr>
                                        <tr></tr>
                                        <tr></tr>
                                        <tr></tr>
                                        <tr></tr>
                                    </tbody>
                                    <tfoot>
                                        <tr></tr>
                                    </tfoot>
                                </table>
                            </div>
                            <div class="table-responsive table mt-2" id="dataTable-2" role="grid" aria-describedby="dataTable_info">
                                <table class="table my-0" id="dataTable">
                                    <thead>
                                        <tr>
                                            <th style="width: 66px;">更改</th>
                                        </tr>
                                    </thead>
                                    <tbody>
                                        <tr style="height: 41px;">
                                            <td><textarea placeholder="简介" style="width: 100%;height: 60px;"></textarea></td>
                                        </tr>
                                        <tr></tr>
                                        <tr></tr>
                                        <tr></tr>
                                        <tr></tr>
                                        <tr></tr>
                                        <tr>
                                            <td><button class="btn btn-primary" type="button" style="width: 76.7031px;height: 36px;padding: 2px;margin: 2px;border-radius: 3px;padding-top: 2px;margin-top: 4px;">修改</button></td>
                                        </tr>
                                    </tbody>
                                    <tfoot>
                                        <tr></tr>
                                    </tfoot>
                                </table>
                            </div>
                        </div>
                    </div>
                    <div class="card shadow">
                        <div class="card-header py-3">
                            <p class="text-primary m-0 fw-bold">培养目标</p>
                        </div>
                        <div class="card-body">
                            <div class="table-responsive table mt-2" id="dataTable-3" role="grid" aria-describedby="dataTable_info">
                                <table class="table my-0" id="dataTable">
                                    <thead>
                                        <tr>
                                            <th style="width: 66px;">初始值</th>
                                        </tr>
                                    </thead>
                                    <tbody>
                                        <tr style="height: 41px;">
                                            <td style="width: 1116px;">成为顶级黑客</td>
                                        </tr>
                                        <tr></tr>
                                        <tr></tr>
                                        <tr></tr>
                                        <tr></tr>
                                        <tr></tr>
                                    </tbody>
                                    <tfoot>
                                        <tr></tr>
                                    </tfoot>
                                </table>
                            </div>
                            <div class="table-responsive table mt-2" id="dataTable-4" role="grid" aria-describedby="dataTable_info">
                                <table class="table my-0" id="dataTable">
                                    <thead>
                                        <tr>
                                            <th style="width: 66px;">更改</th>
                                        </tr>
                                    </thead>
                                    <tbody>
                                        <tr style="height: 41px;">
                                            <td><textarea placeholder="培养目标" style="width: 100%;height: 60px;"></textarea></td>
                                        </tr>
                                        <tr></tr>
                                        <tr></tr>
                                        <tr></tr>
                                        <tr></tr>
                                        <tr></tr>
                                        <tr>
                                            <td><button class="btn btn-primary" type="button" style="width: 76.7031px;height: 36px;padding: 2px;margin: 2px;border-radius: 3px;padding-top: 2px;margin-top: 4px;">修改</button></td>
                                        </tr>
                                    </tbody>
                                    <tfoot>
                                        <tr></tr>
                                    </tfoot>
                                </table>
                            </div>
                        </div>
                    </div>
                    <div class="card shadow">
                        <div class="card-header py-3">
                            <p class="text-primary m-0 fw-bold">培养要求</p>
                        </div>
                        <div class="card-body">
                            <div class="table-responsive table mt-2" id="dataTable-7" role="grid" aria-describedby="dataTable_info">
                                <table class="table my-0" id="dataTable">
                                    <thead>
                                        <tr>
                                            <th style="width: 66px;">初始值</th>
                                        </tr>
                                    </thead>
                                    <tbody>
                                        <tr style="height: 41px;">
                                            <td style="width: 1116px;">java、html的拼写</td>
                                        </tr>
                                        <tr></tr>
                                        <tr></tr>
                                        <tr></tr>
                                        <tr></tr>
                                        <tr></tr>
                                    </tbody>
                                    <tfoot>
                                        <tr></tr>
                                    </tfoot>
                                </table>
                            </div>
                            <div class="table-responsive table mt-2" id="dataTable-8" role="grid" aria-describedby="dataTable_info">
                                <table class="table my-0" id="dataTable">
                                    <thead>
                                        <tr>
                                            <th style="width: 66px;">更改</th>
                                        </tr>
                                    </thead>
                                    <tbody>
                                        <tr style="height: 41px;">
                                            <td><textarea placeholder="培养要求" style="width: 100%;height: 60px;"></textarea></td>
                                        </tr>
                                        <tr></tr>
                                        <tr></tr>
                                        <tr></tr>
                                        <tr></tr>
                                        <tr></tr>
                                        <tr>
                                            <td><button class="btn btn-primary" type="button" style="width: 76.7031px;height: 36px;padding: 2px;margin: 2px;border-radius: 3px;padding-top: 2px;margin-top: 4px;">修改</button></td>
                                        </tr>
                                    </tbody>
                                    <tfoot>
                                        <tr></tr>
                                    </tfoot>
                                </table>
                            </div>
                        </div>
                    </div>
                    <div class="card shadow">
                        <div class="card-header py-3">
                            <p class="text-primary m-0 fw-bold">知识能力</p>
                        </div>
                        <div class="card-body">
                            <div class="table-responsive table mt-2" id="dataTable-5" role="grid" aria-describedby="dataTable_info">
                                <table class="table my-0" id="dataTable">
                                    <thead>
                                        <tr>
                                            <th style="width: 66px;">初始值</th>
                                        </tr>
                                    </thead>
                                    <tbody>
                                        <tr style="height: 41px;">
                                            <td style="width: 1116px;">认字</td>
                                        </tr>
                                        <tr></tr>
                                        <tr></tr>
                                        <tr></tr>
                                        <tr></tr>
                                        <tr></tr>
                                    </tbody>
                                    <tfoot>
                                        <tr></tr>
                                    </tfoot>
                                </table>
                            </div>
                            <div class="table-responsive table mt-2" id="dataTable-6" role="grid" aria-describedby="dataTable_info">
                                <table class="table my-0" id="dataTable">
                                    <thead>
                                        <tr>
                                            <th style="width: 66px;">更改</th>
                                        </tr>
                                    </thead>
                                    <tbody>
                                        <tr style="height: 41px;">
                                            <td><textarea placeholder="知识能力" style="width: 100%;height: 60px;"></textarea></td>
                                        </tr>
                                        <tr></tr>
                                        <tr></tr>
                                        <tr></tr>
                                        <tr></tr>
                                        <tr></tr>
                                        <tr>
                                            <td><button class="btn btn-primary" type="button" style="width: 76.7031px;height: 36px;padding: 2px;margin: 2px;border-radius: 3px;padding-top: 2px;margin-top: 4px;">修改</button></td>
                                        </tr>
                                    </tbody>
                                    <tfoot>
                                        <tr></tr>
                                    </tfoot>
                                </table>
                            </div>
                        </div>
                    </div>
                    <div class="card shadow">
                        <div class="card-header py-3">
                            <p class="text-primary m-0 fw-bold">主要课程</p>
                        </div>
                        <div class="card-body">
                            <div class="table-responsive table mt-2" id="dataTable-9" role="grid" aria-describedby="dataTable_info">
                                <table class="table my-0" id="dataTable">
                                    <thead>
                                        <tr>
                                            <th style="width: 66px;">初始值</th>
                                        </tr>
                                    </thead>
                                    <tbody>
                                        <tr style="height: 41px;">
                                            <td style="width: 1116px;">面向CSDN程序设计</td>
                                        </tr>
                                        <tr></tr>
                                        <tr></tr>
                                        <tr></tr>
                                        <tr></tr>
                                        <tr></tr>
                                    </tbody>
                                    <tfoot>
                                        <tr></tr>
                                    </tfoot>
                                </table>
                            </div>
                            <div class="table-responsive table mt-2" id="dataTable-10" role="grid" aria-describedby="dataTable_info">
                                <table class="table my-0" id="dataTable">
                                    <thead>
                                        <tr>
                                            <th style="width: 66px;">更改</th>
                                        </tr>
                                    </thead>
                                    <tbody>
                                        <tr style="height: 41px;">
                                            <td><textarea placeholder="主要课程" style="width: 100%;height: 60px;"></textarea></td>
                                        </tr>
                                        <tr></tr>
                                        <tr></tr>
                                        <tr></tr>
                                        <tr></tr>
                                        <tr></tr>
                                        <tr>
                                            <td><button class="btn btn-primary" type="button" style="width: 76.7031px;height: 36px;padding: 2px;margin: 2px;border-radius: 3px;padding-top: 2px;margin-top: 4px;">修改</button></td>
                                        </tr>
                                    </tbody>
                                    <tfoot>
                                        <tr></tr>
                                    </tfoot>
                                </table>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
            <footer class="bg-white sticky-footer">
                <div class="container my-auto">
                    <div class="text-center my-auto copyright"><span>Copyright © 四组</span></div>
                </div>
            </footer>
        </div><a class="border rounded d-inline scroll-to-top" href="#page-top"><i class="fas fa-angle-up"></i></a>
    </div>
    <div class="modal fade" role="dialog" tabindex="-1" id="modal-1">
        <div class="modal-dialog" role="document">
            <div class="modal-content">
                <div class="modal-header">
                    <h4 class="modal-title">确认你的操作</h4><button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
                </div>
                <div class="modal-body">
                    <p>你确定要删除吗？</p>
                </div>
                <div class="modal-footer"><button class="btn btn-light" type="button" data-bs-dismiss="modal">取消</button><button class="btn btn-primary" type="button">确认</button></div>
            </div>
        </div>
    </div>
    <script src="assets/bootstrap/js/bootstrap.min.js"></script>
    <script src="assets/js/theme.js"></script>

</div>
</body>

</html>

<script src="js/vue.js"></script>
<script src="js/axios.min.js"></script>
<script>
    const app = new Vue({
        el:'#app',
        data:{
            upId:"",
            college:{},
            collegeName:"",
            region:"",
            type:"",
            level:"",
            lowest:"",
            describes:"",
            teachers:""
        },
        methods:{
            goOffline(){
                const storage = window.localStorage;
                storage.setItem("online","off");
                storage.setItem("userid",'');
                storage.setItem("role","user")
                alert("登出成功, 点击进入登陆页面")
                location.href='../login.html';
            },
            queryCollegeById(id){
                console.log(this.upId)
                axios.get("http://localhost:8080/colleges/queryCollegeById?id="+id).then((res)=>{
                    console.log(res.data)
                    this.college = res.data;
                });
            },
            updateName(){
                console.log(this.collegeName + " " + this.college.describes + " " +
                    this.college.region + " " + this.college.type + " " + this.college.level + " "
                    + this.college.lowest + " " + this.college.teachers );
                if(!this.collegeName){
                    alert("院校名不能为空!")
                }else {
                    axios.post('http://localhost:8080/colleges/updateCollege', {
                        id: this.college.id,
                        name: this.collegeName,
                        region:this.college.region,
                        type:this.college.type,
                        level:this.college.level,
                        describes:this.college.describes,
                        logo:this.college.logo,
                        teachers:this.college.teachers,
                        lowest: this.college.lowest,
                        website: this.college.website
                    }) .then(function (response) {
                        alert("更新成功! ");
                        location.reload();
                    });
                }
            },
            updateRegion(){
                console.log(this.college.name + " " + this.college.describes + " " +
                    this.region + " " + this.college.type + " " + this.college.level + " "
                    + this.college.lowest + " " + this.college.teachers );
                if(!this.region){
                    alert("院校地区不能为空!")
                }else {
                    axios.post('http://localhost:8080/colleges/updateCollege', {
                        id: this.college.id,
                        name: this.college.name,
                        region:this.region,
                        type:this.college.type,
                        level:this.college.level,
                        describes:this.college.describes,
                        logo:this.college.logo,
                        teachers:this.college.teachers,
                        lowest: this.college.lowest,
                        website: this.college.website
                    }) .then(function (response) {
                        alert("更新成功! ");
                        location.reload();
                    });
                }
            },
            updateType(){
                console.log(this.college.name + " " + this.college.describes + " " +
                    this.college.region + " " + this.type + " " + this.college.level + " "
                    + this.college.lowest + " " + this.college.teachers );
                if(!this.type){
                    alert("院校类型不能为空!")
                }else {
                    axios.post('http://localhost:8080/colleges/updateCollege', {
                        id: this.college.id,
                        name: this.college.name,
                        region:this.college.region,
                        type:this.type,
                        level:this.college.level,
                        describes:this.college.describes,
                        logo:this.college.logo,
                        teachers:this.college.teachers,
                        lowest: this.college.lowest,
                        website: this.college.website
                    }) .then(function (response) {
                        alert("更新成功! ");
                        location.reload();
                    });
                }
            },
            updateLevel(){
                console.log(this.college.name + " " + this.college.describes + " " +
                    this.college.region + " " + this.college.type + " " + this.level + " "
                    + this.college.lowest + " " + this.college.teachers );
                if(!this.level){
                    alert("院校等级不能为空!")
                }else {
                    axios.post('http://localhost:8080/colleges/updateCollege', {
                        id: this.college.id,
                        name: this.college.name,
                        region:this.college.region,
                        type:this.college.type,
                        level:this.level,
                        describes:this.college.describes,
                        logo:this.college.logo,
                        teachers:this.college.teachers,
                        lowest: this.college.lowest,
                        website: this.college.website
                    }) .then(function (response) {
                        alert("更新成功! ");
                        location.reload();
                    });
                }
            },
            updateDescribes(){
                console.log(this.college.name + " " + this.describes + " " +
                    this.college.region + " " + this.college.type + " " + this.college.level + " "
                    + this.college.lowest + " " + this.college.teachers );
                if(!this.describes){
                    alert("院校介绍不能为空!")
                }else {
                    axios.post('http://localhost:8080/colleges/updateCollege', {
                        id: this.college.id,
                        name: this.college.name,
                        region:this.college.region,
                        type:this.college.type,
                        level:this.college.level,
                        describes:this.describes,
                        logo:this.college.logo,
                        teachers:this.college.teachers,
                        lowest: this.college.lowest,
                        website: this.college.website
                    }) .then(function (response) {
                        alert("更新成功! ");
                        location.reload();
                    });
                }
            },
            updateTeacher(){
                console.log(this.college.name + " " + this.college.describes + " " +
                    this.college.region + " " + this.college.type + " " + this.college.level + " "
                    + this.college.lowest + " " + this.teachers );
                if(!this.collegeName){
                    alert("师资信息不能为空!")
                }else {
                    axios.post('http://localhost:8080/colleges/updateCollege', {
                        id: this.college.id,
                        name: this.college.name,
                        region:this.college.region,
                        type:this.college.type,
                        level:this.college.level,
                        describes:this.college.describes,
                        logo:this.college.logo,
                        teachers:this.teachers,
                        lowest: this.college.lowest,
                        website: this.college.website
                    }) .then(function (response) {
                        alert("更新成功! ");
                        location.reload();
                    });
                }
            },
            updateLowest(){
                console.log(this.college.name + " " + this.college.describes + " " +
                    this.college.region + " " + this.college.type + " " + this.college.level + " "
                    + this.college.lowest + " " + this.college.teachers );
                if(!this.lowest){
                    alert("最低分信息不能为空!")
                }else {
                    axios.post('http://localhost:8080/colleges/updateCollege', {
                        id: this.college.id,
                        name: this.college.name,
                        region:this.college.region,
                        type:this.college.type,
                        level:this.college.level,
                        describes:this.college.describes,
                        logo:this.college.logo,
                        teachers:this.college.teachers,
                        lowest: this.lowest,
                        website: this.college.website
                    }) .then(function (response) {
                        alert("更新成功! ");
                        location.reload();
                    });
                }
            },
        },
        created(){
            if(window.localStorage.getItem("online")!=="on"){
                window.location='../login.html';
            }else {
                console.log(location.href)
                this.upId = location.href.substring(location.href.indexOf("=") + 1);
                this.queryCollegeById(this.upId);
            }
        }
    })
</script>